package com.tbit.uqbike.service.business.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tbit.common.entity.view.PageResult;
import com.tbit.common.entity.view.Result;
import com.tbit.manager.api.dto.OperationalDataDTO;
import com.tbit.uqbike.compalint.enums.ComplaintStatusEnum;
import com.tbit.uqbike.compalint.mapper.ComplaintMapper;
import com.tbit.uqbike.compalint.table.ComplaintDO;
import com.tbit.uqbike.constant.BrandRemoteConfigConstant;
import com.tbit.uqbike.constant.enums.AccountDayStatEnum;
import com.tbit.uqbike.enums.TodoItemsEnum;
import com.tbit.uqbike.enums.UsageTypeEnum;
import com.tbit.uqbike.object.pojo.*;
import com.tbit.uqbike.object.pojo.dto.AddQuickAccessDTO;
import com.tbit.uqbike.object.pojo.dto.MachineDataDTO;
import com.tbit.uqbike.object.pojo.dto.QuickAccessDTO;
import com.tbit.uqbike.object.pojo.dto.TodoItemsDTO;
import com.tbit.uqbike.object.pojo.vo.*;
import com.tbit.uqbike.object.value.LoginInfo;
import com.tbit.uqbike.object.view.NameObject;
import com.tbit.uqbike.service.business.*;
import com.tbit.uqbike.service.rpcservice.StatService;
import com.tbit.uqbike.webmanager.dao.core.*;
import com.tbit.uqbike.webmanager.dao.log.UsageRemindDao;
import com.tbit.uqbike.webmanager.dao.stat.AccountDayStatDao;
import com.tbit.utils.DateTimeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 工作台
 *
 * @author <a href="mailto:liu.haoxiang@tbit.com.cn">BUGXiang</a>
 * @version 1.0
 * @since 2024-11-13
 */
@Service
@Slf4j
public class WorkbenchServiceImpl implements WorkbenchService {

    @Resource
    private StatService statService;
    @Resource
    private UsageRemindService usageRemindService;
    @Resource
    private SupportService supportService;
    @Resource
    private UserAuthLogService userAuthLogService;
    @Resource
    private SuggestionService suggestionService;
    @Resource
    private OrderFeeAppealService orderFeeAppealService;
    @Resource
    private InvoiceRecordService invoiceRecordService;
    @Resource
    private DepositApplyService depositApplyService;
    @Resource
    private StudentAuthApplyService studentAuthApplyService;
    @Resource
    private ParkPointApplyService parkPointApplyService;
    @Resource
    private DispatchApplyLogService dispatchApplyLogService;
    @Resource
    private AccountDayStatService accountDayStatService;

    @Resource
    private MenuDao menuDao;
    @Resource
    private WorkbenchDao workbenchDao;
    @Resource
    private MachineDao machineDao;
    @Resource
    private UsageRemindDao usageRemindDao;
    @Resource
    private ComplaintMapper complaintMapper;
    @Resource
    private AccountDayStatDao accountDayStatDao;
    @Resource
    private StatDataDao statDataDao;
    @Resource
    private BrandRemoteConfigDao brandRemoteConfigDao;


    /**
     * 查询快捷入口列表
     *
     * @param dto dto
     * @return result
     */
    @Override
    public Result<QueryQuickAccessVO> queryQuickAccess(QuickAccessDTO dto) {
        Map<Integer, Menu> menuMap = menuDao.selectMenuTreeAll().stream().collect(Collectors.toMap(Menu::getMenuId, Menu -> Menu));
        if (CollectionUtil.isEmpty(menuMap)) {
            return Result.error("菜单信息为空");
        }
        QueryQuickAccessVO vo = new QueryQuickAccessVO();
        List<QuickAccess> quickAccessList = workbenchDao.queryQuickAccess(dto).stream().sorted(Comparator.comparing(QuickAccess::getSort)).collect(Collectors.toList());
        List<Menu> menuList = quickAccessList.stream()
                .map(quickAccess -> menuMap.get(quickAccess.getMenuId()))
                .filter(Objects::nonNull).collect(Collectors.toList());
        vo.setIsUsed(workbenchDao.selectIsUsed(dto) > 0);
        vo.setMenuData(menuList);
        return Result.success(vo);
    }


    /**
     * 编辑快捷入口
     *
     * @param dto dto
     * @return result
     */
    @Override
    public Result<Object> addQuickAccess(AddQuickAccessDTO dto) {
        workbenchDao.deleteQuickAccess(dto);
        List<QuickAccess> quickAccessList = new ArrayList<>();
        if (CollectionUtil.isNotEmpty(dto.getMenuIds())) {
            quickAccessList = dto.getMenuIds().stream()
                    .map(menuDTO -> {
                        QuickAccess quickAccess = new QuickAccess();
                        quickAccess.setBrandId(dto.getBrandId())
                                .setAccountUserId(dto.getAccountUserId())
                                .setType(dto.getType())
                                .setMenuId(menuDTO.getMenuId())
                                .setSort(menuDTO.getSort())
                                .setAddTime(new Date());
                        return quickAccess;
                    })
                    .collect(Collectors.toList());
        }else {
            QuickAccess quickAccess = new QuickAccess();
            quickAccess.setBrandId(dto.getBrandId())
                    .setType(dto.getType())
                    .setAccountUserId(dto.getAccountUserId())
                    .setAddTime(new Date());
            quickAccessList.add(quickAccess);
        }
        workbenchDao.batchInsertQuickAccess(quickAccessList);
        return Result.success();
    }


    /**
     * 代办事项
     *
     * @return result
     */
    @Override
    public Result< Map<String, Object>> todoItems(TodoItemsDTO dto) {
        Map<String, Object> todoItems = new HashMap<>();
        if (0 == dto.getType()) {
            //运维端
            todoItems = getMainTodoItems(dto);

        } else if (1 == dto.getType()) {
            //管理端
            if (Objects.isNull(dto.getBrandId()) || CollectionUtil.isEmpty(dto.getAccountIds())) {
                return Result.error("品牌id或区域id不能为空");
            }
            todoItems = getTodoItems(dto);
        }
        return Result.success(todoItems);
    }

    /**
     * 车辆数据概况
     *
     * @param dto dto
     * @return result
     */
    @Override
    public Result<MachineDataVO> machineData(MachineDataDTO dto) {
        if (CollectionUtil.isEmpty(dto.getAccountIds())) {
            return Result.error("请选择区域");
        }
        MachineDataVO machineDataVO = new MachineDataVO();
        //低电-超区-站外
        List<MachineStatusVO> machineStatusVOS = machineDao.selectMachineAbnormal(dto.getAccountIds(), dto.getRegionId());
        // 检查 abnormalType 是否为空，如果为空则设置为 0
        if (CollectionUtil.isEmpty(machineStatusVOS)) {
            machineDataVO.setNumberOfVehiclesWithoutSignal(0);
            machineDataVO.setNumberOfVehiclesOutArea(0);
            machineDataVO.setNumberOfVehiclesOutside(0);
        }
        // 初始化标志变量
        boolean noSignal = false;
        boolean outArea = false;
        for (MachineStatusVO machineStatusVO : machineStatusVOS) {
            switch (machineStatusVO.getAbnormalType()) {
                case 0:
                    machineDataVO.setNumberOfVehiclesOutArea(machineStatusVO.getCount());
                    outArea = true;
                    break;
                case 2:
                    machineDataVO.setNumberOfVehiclesWithoutSignal(machineStatusVO.getCount());
                    noSignal = true;
                    break;
                default:
                    log.info("未知的类型:{}", machineStatusVO.getAbnormalType());
            }
        }
        checkZero(noSignal, machineDataVO, outArea);
        machineDataVO.setNumberOfVehiclesOutside(machineDao.selectOutSiteCount(dto.getAccountIds(), dto.getRegionId()));
        machineDataVO.setNumberOfFaultyVehicles(machineDao.selectFaultCount(dto.getAccountIds(), dto.getRegionId()));
        machineDataVO.setNumberOfLowVoltageVehicles(machineDao.selectLowBatteryCount(dto.getAccountIds(), dto.getRegionId()));
        machineDataVO.setNumberOfVehiclesWithoutPositioning(machineDao.selectWithoutCount(dto.getAccountIds(), dto.getRegionId()));
        return Result.success(machineDataVO);
    }

    /**
     * 工作台运营收入
     * @param accountIdList 区域id列表
     * @return result
     */
    @Override
    public Result<WorkBenchRevenueVO> operatingRevenue(Integer brandId, List<Integer> accountIdList) {
        /*获取当月时间*/
        DateTime now = DateUtil.date();
        String startDate = DateUtil.format(DateUtil.beginOfMonth(now), "yyyyMMdd");
        String endDate = DateUtil.format(now, "yyyyMMdd");

        /*查询预统计数据*/
        Map<String, Object> resultMap = getOperationalDataVOResult(brandId, accountIdList, DateUtil.parse(startDate), DateUtil.parse(endDate),
                ListUtil.toList(AccountDayStatEnum.OPERATING_INCOME.getDataType(), AccountDayStatEnum.OPERATING_EXPENSES.getDataType()));

        WorkBenchRevenueVO vo = new WorkBenchRevenueVO();
        vo.setTotalOperatingRevenue(Double.parseDouble(resultMap.getOrDefault(AccountDayStatEnum.OPERATING_INCOME.getSumFieldName(), 0).toString()))
                .setTotalOperationRefund(Double.parseDouble(resultMap.getOrDefault(AccountDayStatEnum.OPERATING_EXPENSES.getSumFieldName(), 0).toString()))
                .setNetOperatingIncome(Double.parseDouble(resultMap.getOrDefault(AccountDayStatEnum.OPERATING_INCOME.getPureFileIdName(), 0).toString()));

        /*折线图*/
        List<String> findTimeList = DateTimeUtil.findDaysStr(DateUtil.format(DateUtil.beginOfMonth(now), "yyyy-MM-dd"), DateUtil.format(now, "yyyy-MM-dd"));
        List<AccountDayStat> accountDayStatList = accountDayStatDao.selectOperatingRevenueGroupByDay(brandId, accountIdList, startDate, endDate);

        /*封装运营收入数据*/
        Map<String, WorkBenchLineRevenueChartVO> map = new HashMap<>();
        for (AccountDayStat accountDayStat : accountDayStatList) {
            WorkBenchLineRevenueChartVO chartVO = map.computeIfAbsent(
                    accountDayStat.getFlag(),
                    key -> new WorkBenchLineRevenueChartVO(key, 0D, 0D, 0D)
            );

            if (Objects.equals(accountDayStat.getDataType(), AccountDayStatEnum.OPERATING_INCOME.getDataType())){
                chartVO.setTotalOperatingRevenue((double)accountDayStat.getSumTotal());
            }
            if (Objects.equals(accountDayStat.getDataType(), AccountDayStatEnum.OPERATING_EXPENSES.getDataType())){
                chartVO.setTotalOperationRefund((double)accountDayStat.getSumTotal());
            }
            map.put(accountDayStat.getFlag(), chartVO);
        }

        /*封装收益 计算净收入*/
        List<WorkBenchLineRevenueChartVO> totalOperatingRevenueLineChart = new ArrayList<>();
        for (String date : findTimeList) {
            WorkBenchLineRevenueChartVO chartVO = new WorkBenchLineRevenueChartVO(date, 0D, 0D, 0D);
            if (Objects.nonNull(map.get(date))){
                chartVO.setTotalOperatingRevenue(map.get(date).getTotalOperatingRevenue() == 0 ? 0D : NumberUtil.div(map.get(date).getTotalOperatingRevenue().doubleValue(), 100))
                        .setTotalOperationRefund(map.get(date).getTotalOperationRefund() == 0 ? 0D : NumberUtil.div(map.get(date).getTotalOperationRefund().doubleValue(), 100));
                /*计算净收入*/
                chartVO.setNetOperatingIncome(NumberUtil.sub(chartVO.getTotalOperatingRevenue(), chartVO.getTotalOperationRefund()));
            }
            totalOperatingRevenueLineChart.add(chartVO);
        }
        // 对列表进行排序
        totalOperatingRevenueLineChart.sort(Comparator.comparing(WorkBenchLineRevenueChartVO::getDate));
        vo.setTotalOperatingRevenueLineChart(totalOperatingRevenueLineChart);

        return Result.success(vo);
    }


    /**
     * 工作台用户概览
     * @param accountIds 区域id列表
     * @return Result<Object>
     */
    @Override
    public Result<Object> userOverview(List<Integer> accountIds, Integer brandId) {
        UserOverviewVO userOverviewVO = new UserOverviewVO(0, 0, null, null);
        userOverviewVO.setNewUserCount(accountDayStatDao.getUserCount(brandId,accountIds,AccountDayStatEnum.NUMBER_OF_NEW_USERS.getDataType()));
        userOverviewVO.setUserCount(accountDayStatDao.getUserCount(brandId,accountIds,AccountDayStatEnum.CUMULATIVE_NUMBER_OF_USERS.getDataType()));
        userOverviewVO.setSexChartList(statService.groupBySex(accountIds));
        userOverviewVO.setBirthChartList(statService.groupByBirth(accountIds));
        return Result.success(userOverviewVO);
    }


    /**
     * 工作台车辆概览
     * @param accountIds 区域id
     * @param brandId   品牌id
     * @return Result<Object>
     */
    @Override
    public Result<Object> machineOverview(List<Integer> accountIds, Integer brandId, LoginInfo li) {
        WorkBenchMachineVO workBenchMachineVO = new WorkBenchMachineVO();
        workBenchMachineVO.setRealTimePowerChartList(statDataDao.realTimePower(accountIds));
        workBenchMachineVO.setIdleMachineChartList(statDataDao.idleMachine(accountIds));
        Date date = new Date();
        String accountIdStr = accountIds.stream()
                .map(String::valueOf)
                .collect(Collectors.joining(","));
        VehicleOperationVO vehicleOperationVO = accountDayStatService.queryVehicleOperationVO(new OperationalDataDTO(date, date, brandId, accountIdStr));
        workBenchMachineVO.setMachineDetails(Objects.nonNull(vehicleOperationVO) ? vehicleOperationVO.getVehicleOperationSumVO() : null);
        return Result.success(workBenchMachineVO);
    }

    /**
     *  获取预统计数据
     * @param brandId            品牌id
     * @param startDate          开始时间
     * @param endDate            结束时间
     * @param accountIdList      区域id
     * @return Map<String, Object>
     */
    private Map<String, Object> getOperationalDataVOResult(Integer brandId, List<Integer> accountIdList, Date startDate, Date endDate, List<Integer> dataTypeList) {

        Map<Integer, Map<String, BigDecimal>> dataMap = accountDayStatDao.operationalDataNew(parseTime(startDate),
                parseTime(endDate), accountIdList, brandId, dataTypeList);
        if (CollectionUtils.isEmpty(dataMap)){
            return new HashMap<>();
        }
        Map<String, Object> map = initResultMap(dataMap, AccountDayStatEnum.getOperationEnums());
        //净收入
        computePure(AccountDayStatEnum.OPERATING_INCOME, AccountDayStatEnum.OPERATING_EXPENSES, map, dataMap);
        return map;
    }


    /**
     * 计算净收入
     *
     * @param incomeEnum  收入枚举
     * @param expenseEnum 支出枚举
     * @param resultMap   返回的map
     * @param dataMap     数据库查询统计的数据
     */
    public void computePure(AccountDayStatEnum incomeEnum, AccountDayStatEnum expenseEnum, Map<String, Object> resultMap, Map<Integer, Map<String, BigDecimal>> dataMap) {
        //收入
        Map<String, BigDecimal> incomeStat = dataMap.get(incomeEnum.getDataType());
        long income = incomeStat == null ? 0 : incomeStat.get("sumTotal").longValue();
        //支出
        Map<String, BigDecimal> expenseStat = dataMap.get(expenseEnum.getDataType());
        long expense = expenseStat == null ? 0 : expenseStat.get("sumTotal").longValue();
        //净收入 = 收入-支出
        resultMap.put(incomeEnum.getPureFileIdName(), fenToYuan(income - expense));
    }

    /**
     * 获取yyyyMMdd格式的时间
     * @return yyyyMMdd
     */
    private Integer parseTime(Date date) {
        if (date == null) {
            return null;
        }
        return Integer.parseInt(DateUtil.format(date, "yyyyMMdd"));
    }

    /**
     * 初始化返回的map
     * @return Map<String, Object>
     */
    private Map<String, Object> initResultMap(Map<Integer, Map<String, BigDecimal>> dataMap, AccountDayStatEnum... values) {
        Map<String, Object> resultMap = new HashMap<>();
        for (AccountDayStatEnum value : values) {
            Map<String, BigDecimal> stat = dataMap.get(value.getDataType());
            BigDecimal cntTotal = new BigDecimal(0);
            BigDecimal sumTotal = new BigDecimal(0);
            if (stat != null) {
                cntTotal = stat.get("cntTotal");
                sumTotal = stat.get("sumTotal");
            }
            resultMap.put(value.getCntFieldName(), cntTotal);
            resultMap.put(value.getSumFieldName(), fenToYuan(sumTotal.longValue()));
        }
        return resultMap;
    }

    /**
     * 分转元
     *
     * @param fen 分
     * @return 元
     */
    public Double fenToYuan(long fen) {
        return fen == 0 ? 0.0D : (double) fen / 100;
    }



    /**
     * 检查标志变量是否为false，如果是则设置默认值
     */
    private static void checkZero(boolean noSignal, MachineDataVO machineDataVO, boolean outArea) {
        // 循环结束后检查标志并设置默认值
        if (!noSignal) {
            machineDataVO.setNumberOfVehiclesWithoutSignal(0);
        }
        if (!outArea) {
            machineDataVO.setNumberOfVehiclesOutArea(0);
        }
    }


    /**
     * 获取运维端代办数量
     *
     * @param dto dto
     * @return Map
     */
    private Map<String, Object> getMainTodoItems(TodoItemsDTO dto) {
        Map<String, Object> items = new HashMap<>(16);
        List<Integer> accountIds = new ArrayList<>();
        accountIds.add(dto.getAccountId());
        int suggestionCount = suggestionService.queryAllCount(accountIds, null, null);
        items.put(TodoItemsEnum.FEEDBACK.getKey(), suggestionCount);
        Result<PageResult<DispatchApplyVO>> pageResultResult = dispatchApplyLogService.listPage(dto.getAccountId(), null, 0, null, 1, 999, null, null);
        items.put(TodoItemsEnum.DISPATCHAPPLYRECORD.getKey(), pageResultResult.getData().getTotal());

        return items;
    }


    /**
     * 获取管理端代办数量
     *
     * @param dto dto
     * @return Map
     */
    private Map<String, Object> getTodoItems(TodoItemsDTO dto) {
        // 获取当前日期
        LocalDate today = LocalDate.now();
        // 获取30天前的日期
        LocalDate thirtyDaysAgo = today.minusDays(30);
        // 获取30天前的开始时间（00:00:00）
        LocalDateTime startOfThirtyDaysAgo = thirtyDaysAgo.atStartOfDay();
        // 获取今天的结束时间（23:59:59）
        LocalDateTime endOfToday = today.atTime(LocalTime.MAX);
        //转换为Date对象
        Date startDate = Date.from(startOfThirtyDaysAgo.atZone(ZoneId.systemDefault()).toInstant());
        Date endDate = Date.from(endOfToday.atZone(ZoneId.systemDefault()).toInstant());
        Map<String, Object> items = initItems();
        try {
            //sim&优驱API
            BrandRemoteConfig brandRemoteConfig = brandRemoteConfigDao.getBrandRemoteConfig(dto.getBrandId(), BrandRemoteConfigConstant.RUSH_PAY_FEE);
            RushPayFeeConfig config = null;
            if (Objects.nonNull(brandRemoteConfig)){
                config = new RushPayFeeConfig().getRushPayFeeConfigByStr(brandRemoteConfig.getParamKV());
            }
            Result<UsageMessageVO> message = usageRemindService.getMessage(dto.getBrandId());
            if (Objects.nonNull(message.getData()) && StrUtil.isNotEmpty(message.getData().getMessage())) {
                if (Objects.nonNull(config) && config.getUsageFlag() == 1){
                    //获取对应品牌的sim卡到期数量和优驱API剩余用量
                    List<UsageVO> usageList = usageRemindDao.selectUsage(dto.getBrandId());
                    for (UsageVO usageVO : usageList) {
                        if (UsageTypeEnum.SIM.getValue() == usageVO.getType() && config.getSimExpirationTime() > 0){
                            items.put(TodoItemsEnum.SIM.getKey(), usageVO.getCurrentUsage());
                        }else if (config.getApiCount() > 0){
                            items.put(TodoItemsEnum.API.getKey(), 1);
                        }
                    }
                }

            }
            //服务费催缴
            RushPayFeeConfig rushPayFeeConfig = supportService.queryRushPayFeeConfig(dto.getBrandId());
            if (Objects.nonNull(rushPayFeeConfig) && rushPayFeeConfig.getFlag() == 1) {
                items.put(TodoItemsEnum.SERVICECHARGE.getKey(), 1);
            }

            //学生认证审核
            List<StudentAuthApply> studentAuthApplies = studentAuthApplyService.queryPage(dto.getBrandId(), 0, startDate, endDate);
            items.put(TodoItemsEnum.STUDENTAUTHENTICATION.getKey(), studentAuthApplies.size());

            //特殊人群认证
            Result<PageResult<UserAuthLog>> pageResultResult = userAuthLogService.queryPage(1, 999, dto.getBrandId(), null, null, null, null, 0, startDate, endDate);
            items.put(TodoItemsEnum.SPECIALPEOPLE.getKey(), pageResultResult.getData().getTotal());

            //意见反馈总数量
            int count = suggestionService.queryAllCount(dto.getAccountIds(), startDate, endDate);
            items.put(TodoItemsEnum.FEEDBACKONOPINIONS.getKey(), count);

            //订单费用申诉
            FeeAppeal feeAppeal = new FeeAppeal();
            feeAppeal.setAccountIds(dto.getAccountIds());
            feeAppeal.setState(0);
            feeAppeal.setStartTime(startDate);
            feeAppeal.setEndTime(endDate);
            List<FeeAppeal> info = orderFeeAppealService.getInfo(feeAppeal);
            items.put(TodoItemsEnum.EXPENSEAPPEAL.getKey(), info.size());

            //代开发票
            PageResult<InvoiceRecord> invoiceRecordPageResult = invoiceRecordService.listPage(null, null, 0, startDate.getTime(), endDate.getTime(), dto.getBrandId(), null, 1, 500);
            items.put(TodoItemsEnum.INVOICE.getKey(), invoiceRecordPageResult.getTotal());

            //退押
            PageResult<DepositApply> depositApplyPageResult = depositApplyService.queryPage(dto.getBrandId(), null, startDate.getTime(), endDate.getTime(), null, 0, 1, 500);
            items.put(TodoItemsEnum.DEPOSIT.getKey(), depositApplyPageResult.getTotal());

            //站点审核
            int parkPointCount = parkPointApplyService.queryCountIds(dto.getAccountIds(), 0, startDate, endDate);
            items.put(TodoItemsEnum.SITE.getKey(), parkPointCount);

            //客诉待办事项
            Long complaintCount = complaintMapper.selectCount(new LambdaQueryWrapper<ComplaintDO>()
                    .eq(ComplaintDO::getBrandId,dto.getBrandId())
                    .eq(ComplaintDO::getStatus, ComplaintStatusEnum.NEW.getCode())
                    .between(ComplaintDO::getComplaintTime,startDate,endDate));
            items.put(TodoItemsEnum.COMPLAINT.getKey(), complaintCount);

        } catch (Exception e) {
            log.error("获取代办数量异常", e);
        }
        return items;
    }

    /**
     * 初始化代办数量
     *
     * @return Map
     */
    private Map<String, Object> initItems() {
        Map<String, Object> items = new HashMap<>();
        items.put(TodoItemsEnum.SIM.getKey(), 0);
        items.put(TodoItemsEnum.API.getKey(), 0);
        items.put(TodoItemsEnum.SERVICECHARGE.getKey(), 0);
        items.put(TodoItemsEnum.STUDENTAUTHENTICATION.getKey(), 0);
        items.put(TodoItemsEnum.SPECIALPEOPLE.getKey(), 0);
        items.put(TodoItemsEnum.FEEDBACKONOPINIONS.getKey(), 0);
        items.put(TodoItemsEnum.EXPENSEAPPEAL.getKey(), 0);
        items.put(TodoItemsEnum.INVOICE.getKey(), 0);
        items.put(TodoItemsEnum.DEPOSIT.getKey(), 0);
        items.put(TodoItemsEnum.SITE.getKey(), 0);
        return items;
    }
}
